<!DOCTYPE html>
<html>

<include file="./Application/Admin/View/common/css-js.html"/>
<script src="/Public/laydate/laydate.js"></script>
<style type="text/css">
    ul{
        list-style: none;
    }
</style>
<body class="gray-bg">
<div style="padding-left:1%">
    <br>
    <h2></h2>
    <span style="display:block;padding-bottom:0.5%;font-size:18Px"> <span class='text-danger'>{$count}</span>
    </span>
    <div style="border:1px solid #CCCCCC;"></div>
</div>
<form method="post" class="form"  action="/index.php/admin/index/reward_search">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="btn-group btn-group-sm" style="float:left;">
            <button class="btn btn-default btn-sm" type="button" data-toggle="refresh"><a href="/index.php/admin/index/rewardlist"><i class="fa fa-refresh"></i></a></button>

        </div>
        <div style="float:left">
            <div style="float:right">
                <input type="text" id="tel"   name="tel" value="<?php echo $tel;?>" style="width:300px;height:30Px" placeholder="请输入要查询员工的手机号">
                <select id="mySelect">
                    <option value="1">按月份</option>
                    <option value="2">按日期</option>
                </select>
                <input type="text" id="month" class="tdates"  value="<?php echo $month;?>" style="width:300px;height:30Px;display: none" placeholder="输入获得奖金日期">
                <input type="text" id="date" class="mdates"  value="<?php echo $date;?>" style="width:300px;height:30Px;display: none" placeholder="输入获得奖金日期">
                <input type="hidden" id="dates" name="date" value="">
                <span>
            <!-- <button class="btn btn-sm btn-primary" type="submit" id="search" onclick="searchuser()"> 搜索</button> -->
            <button class="btn btn-sm btn-primary" type="submit" id="search"> 搜索</button>
        </span>
            </div>

        </div>
    </div>

</form>
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>查询结果</h5>
                    <notempty name="commissions">
                        <span style="padding-left: 3rem">奖金总数：{$commissions}</span>
                    </notempty>

                    <notempty name="commission">
                        <span style="padding-left: 3rem">查询结果：{$commission}</span>
                    </notempty>
                </div>
                <div class="ibox-content" style="width:100%;height:550px;overflow-y:scroll;overflow-x:hidden;">
                    <div class="mui-scroll">
                        <if condition="$commissions==0">
                            <ul></ul>
                            <else/>
                            <empty name="team1">
                                <ul></ul>
                                <else/>
                                <p style="color: #4f4f4f; width: 100%;font-size:18px;height:2rem; line-height:3rem;clear: both; text-align: left; text-indent:1em">一级分销团队&nbsp;&nbsp;&nbsp;&nbsp;<volist name="info1" id="vo">手机号：&nbsp;{$vo.tel}&nbsp;&nbsp;工资总额：&nbsp;{$vo.tcje}&nbsp;&nbsp;</volist></p>

                                <p style=" width: 20%; height: 0.2rem; background:#584070; margin-left: 5%"></p>
                                <ul class="mui-table-view">
                                    <volist name='team1' id='vo'>
                                        <li style="height:8%; text-align: left;margin-left: 1rem;line-height: 2.5rem;" class="mui-table-view-cell">
                                            <div style="float:left;padding-top:1%;width: 25%;">员工手机:{$vo.tel}</div>
                                            <div style="float:left;padding-top:1%;width: 25%;">贡献金额:{$vo.money|number_format=2}</div>
                                            <div style="float:left;padding-top:1%;width: 25%;">该笔工资金额:{$vo.tcje|number_format=2}</div>
                                            <div style="float:left;padding-top:1%;width: 25%;">该笔工资结算日期:{$vo.time}</div>
                                        </li>
                                    </volist>
                                </ul>
                            </empty>
                            <empty name="team2">
                                <ul></ul>
                                <else/>
                                <p style=" color: #4f4f4f; width: 100%;font-size:18px;height:2rem; line-height:3rem;clear: both; text-align: left; text-indent:1em">二级分销团队&nbsp;&nbsp;&nbsp;&nbsp;<volist name="info2" id="vo">手机号：&nbsp;{$vo.tel}&nbsp;&nbsp;工资总额：&nbsp;{$vo.tcje}&nbsp;&nbsp;</volist></p>
                                <p style=" width: 20%; height: 0.2rem; background:#584070; margin-left: 5%"></p>
                                <ul class="mui-table-view">
                                    <volist name='team2' id='vo'>
                                        <li style="height:8%; text-align: left;margin-left: 1rem;line-height: 2.5rem;" class="mui-table-view-cell">
                                            <div style="float:left;padding-top:1%;width: 25%;">员工手机:{$vo.tel}</div>
                                            <div style="float:left;padding-top:1%;width: 25%;">贡献金额:{$vo.money|number_format=2}</div>
                                            <div style="float:left;padding-top:1%;width: 25%;">该笔工资金额:{$vo.tcje|number_format=2}</div>
                                            <div style="float:left;padding-top:1%;width: 25%;">该笔工资结算日期:{$vo.time}</div>
                                        </li>
                                    </volist>
                                </ul>
                            </empty>
                            <empty name="team3">
                                <ul></ul>
                                <else/>
                                <p style=" color: #4f4f4f; width: 100%;font-size:18px;height:2rem; line-height:3rem;clear: both; text-align: left; text-indent:1em">三级分销团队&nbsp;&nbsp;&nbsp;&nbsp;<volist name="info3" id="vo">手机号：&nbsp;{$vo.tel}&nbsp;&nbsp;工资总额：&nbsp;{$vo.tcje}&nbsp;&nbsp;</volist></p>
                                <p style=" width: 20%; height: 0.2rem; background:#584070; margin-left: 5%"></p>
                                <ul class="mui-table-view">
                                    <volist name='team3' id='vo'>
                                        <li style="height:8%; text-align: left;margin-left: 1rem;line-height: 2.5rem;" class="mui-table-view-cell">
                                            <div style="float:left;padding-top:1%;width: 25%;">员工手机:{$vo.tel}</div>
                                            <div style="float:left;padding-top:1%;width: 25%;">贡献金额:{$vo.money|number_format=2}</div>
                                            <div style="float:left;padding-top:1%;width: 25%;">该笔工资金额:{$vo.tcje|number_format=2}</div>
                                            <div style="float:left;padding-top:1%;width: 25%;">该笔工资结算日期:{$vo.time}</div>
                                        </li>
                                    </volist>
                                </ul>
                            </empty>
                        </if>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
<script>
    var id = '1';

    $(function(){
        $('select option').each(function(){
            if($(this).val() ==id){
                $(this).attr('selected',"selected")
                laydate.render({
                    elem: '#month' //指定元素
                    ,type: 'month'
                });
            }else if($(this).val() ==id){
                $(this).attr('selected',"selected")
                laydate.render({
                    elem: '#date' //指定元素
                });
            }
        })
        $('#month').show();

    });
    $(".form").submit(function(e){
        if(id =='1'){
            $('#dates').val($('.tdates').val())
        }
        if(id =='2'){
            $('#dates').val($('.mdates').val())
        }
    });

    $("#mySelect").change(function(){
        id = $(this).val()

        $('#month').show();
        $('#date').hide();
        if(id == '1'){
            laydate.render({
                elem: '#month' //指定元素
                ,type: 'month'
            });
        }else if(id == '2'){
            $('#month').hide();
            $('#date').show();
            laydate.render({
                elem: '#date' //指定元素
            });
        }
    });

</script>

</body>

</html>
